#include "random_generator.h"

namespace Sirat {

namespace Common {

Random_Generator::Random_Generator(const double begin,const double end) {
	boost::mt19937* mersenne_twister = new boost::mt19937(time(NULL));
	boost::uniform_real<>* real_dist = new boost::uniform_real<>(begin,end);
	random = new boost::variate_generator<boost::mt19937&, boost::uniform_real<> >(*mersenne_twister,*real_dist);
}

double Random_Generator::generate() const{
	return (*random)();
}

Random_Generator::~Random_Generator(void) {
	delete random;
}

}

}
